import { IPSDynaModelAttr } from './ipsdyna-model-attr';
import { IPSSysDynaModel } from './ipssys-dyna-model';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSSysDynaModelImpl extends PSModelObjectImpl implements IPSSysDynaModel {
  get codeName(): string {
    return this.M.codeName;
  }

  get content(): string {
    return this.M.content;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get memo(): string {
    return this.M.memo;
  }

  get modelTag(): string {
    return this.M.modelTag;
  }

  get modelTag2(): string {
    return this.M.modelTag2;
  }

  get modelTag3(): string {
    return this.M.modelTag3;
  }

  get modelTag4(): string {
    return this.M.modelTag4;
  }

  get name(): string {
    return this.M.name;
  }

  protected psdynamodelattrs: IPSDynaModelAttr[] | null = null;

  getPSDynaModelAttrs(): IPSDynaModelAttr[] | null {
    if (this.psdynamodelattrs == null) {
      this.psdynamodelattrs = this.fillChildListModel(this.M.getPSDynaModelAttrs, 'dynamodel.IPSDynaModelAttr') as IPSDynaModelAttr[];
    }
    return this.psdynamodelattrs;
  }

  get psDynaModelAttrs(): IPSDynaModelAttr[] | null {
    return this.getPSDynaModelAttrs();
  }

  findPSDynaModelAttr(objKey: any): IPSDynaModelAttr | null {
    return this.getPSModel5('dynamodel.IPSDynaModelAttr', this.getPSDynaModelAttrs(), objKey) as IPSDynaModelAttr;
  }

  get usage(): 'DATA' | 'STRUCT' | 'JSONSCHEMA' | 'OPENAPI3SCHEMA' | 'LIQUIBASECHANGELOG' | 'IM_JSONSCHEMA' {
    return this.M.usage || 'DATA';
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSSysDynaModelImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'IPSModelObject' || cls == 'IPSObject' || cls == 'dynamodel.IPSDynaModel' || cls == 'dynamodel.IPSSysDynaModel') return true;
    return super.instanceof(cls);
  }
}
